﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace MVCT9.Controllers
{
    public class ImageController : Controller
    {
        // GET: Image
        public ActionResult Index()
        {
            return View();
        
        }
        public ActionResult Image(string id)
        {

            string path = Server.MapPath("/images/" + id + ".jpg");

            return File(path, "image/jpeg");//File()  能根据传入path参数返回相应的类型；

        }
        public ActionResult DOWN()
        {

            var path = Server.MapPath("~/Files/日志.txt");
            var name = Path.GetFileName(path);
            return File(path, "application/x-zip-compressed", name);

        }

        }
    }